import * as API from '../utils/api'

export const LOAD_LONG_RENT_LIST = 'LOAD_LONG_RENT_LIST'
export const UPDATE_LONG_RENT_LIST = 'UPDATE_LONG_RENT_LIST'

export const loadLongRentList = ({page = 1}) => dispatch => 
    ( 
        API.fetchLongRentList({page})
        .then(json => dispatch(updateLongRentList({...json})))
    )


export const updateLongRentList = list => ({
    type: UPDATE_LONG_RENT_LIST,
    list
})